package java115.Thread;
//实现 Runnable, 重写 run, 使用匿名内部类
public class Demo4 {
    public static void main(String[] args) {
        Runnable r = new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 5; i++) {
                    System.out.println(Thread.currentThread().getName() + " is running");
                }
            }
        };
        Thread ti = new Thread(r);
        ti.start();
    }
}